<template>
  
    <body>
    <iframe id="player" allowfullscreen="allowfullscreen" webkitallowfullscreen="true" mozallowfullscreen="true" style="width: 100%; height: 600px;background-color:black;"></iframe>
    </body>

</template>

<script>
export default {
  // eslint-disable-next-line vue/multi-word-component-names
  name:'video',
  methods:{
  play(url) {
      
      this.$store.commit('history',url)
      document.getElementById("player").src = 'https://video.ihelpy.net/player/getplayer?url='+url  }
  },
  mounted(){
    console.log(this.$store.state.searchTitle)
    this.title=this.$store.state.searchTitle
    this.play(this.title);
  },
  data(){
    return{
      title:''
    }
  },
  watch:{
    title(to){
      this.play(to)
    }
  }
       

}
</script>
